Skip to content

[cherry-pick] sessions: Add inline remote management actions - #344266

Merged
Christof Marti (chrmarti) merged 1 commit into
release/1.144from
cherry-pick/344228
Oct 26, 2026
Merged

Christof Marti (chrmarti) merged 1 commit into
release/1.144from
cherry-pick/344228

Conversation

@vs-code-engineering

Copy link
Copy Markdown
Contributor

Cherry-pick of #344228 from main.

Summary

Bring the Remote Environments editor closer to the Environment picker's Manage action picker:

  • Add inline Copy Address to every remote row, including offline and busy rows. Copy the connection address, not the display name, without connecting.
  • Add inline Change Preferred Agent Location to SSH and tunnel rows. Reuse the existing prompt, preference storage, reconnect, cancellation, and notification behavior. SSH preferences use the stable host identity rather than a forwarded port, including when no provider is currently available. Disable this action during an existing connection or management operation.
  • Add inline Update Server for incompatible hosts advertising an upgrade method. Reuse the existing progress, restart delay, reconnect, and notification flow; revalidate the capability on invocation, prevent duplicate requests, and restore keyboard focus when the action disappears.
  • Add inline Delete for supported tunnel rows, including discovered/offline tunnels. Share the confirmation dialog with the Tunnels picker and delete the service-side registration through the existing service, not the local Remove action. Protect the tunnel currently hosted by this application, revalidate after confirmation, retain rows on failure, and prevent stale discovery from restoring a deleted row.
  • Prefer fresh tunnel discovery metadata over cached records and stale provider labels in Remotes, while preserving explicit local display-name overrides.
  • Preserve keyboard navigation, focus restoration, and shared toolbar hover behavior; update accessibility help and add regression tests and four-theme action fixtures.

Created from freshly pulled main at ff05b50d4ef; this is not stacked on the previous Remotes PR.

Related functional test plan: #344161.

Remaining Manage-action parity gaps

These are reported, not implemented in this PR:

  • Remove Remote for removable non-environment hosts. This is distinct from the Environment and tunnel rows' service-side Delete operations.
  • Exact per-row Open Settings / Open SSH Configuration access. Section-level configuration actions cover much of this, but do not reproduce every host-specific route (notably WSL and explicit-credential SSH).

WebSocket hosts remain outside this editor and retain their existing Manage route.

Validation

Passed:

  • npm run gulp compile-client - initial client compilation and type-check, zero errors.
  • npm run typecheck-client - final client type-check including confirmed tunnel deletion, passed.
  • npm run build-fast -- --client-only - refreshed client output after the final test and fixture changes.
  • The following Electron selection - 245 passing:
.\scripts\test.bat --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesModel.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesWidget.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remoteHostOptions.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remoteAgentHostActions.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\electron-browser\remotesEditor.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\electron-browser\tunnelAgentHostServiceImpl.test.ts --reporter dot
  • Browser tests - 389 passing across WebKit and Edge:
npm run test-browser-no-install -- --browser webkit --browser chromium-msedge --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesModel.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesWidget.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remoteHostOptions.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remoteAgentHostActions.test.ts --reporter dot
  • Changed-file ESLint and hygiene - 10 files passed; git diff --check passed. Commands were run before committing:
$files = @(git diff --name-only -- '*.ts')
npm run eslint -- $files
node build\hygiene.ts $files
git diff --check
  • Component Explorer: all 64 Remotes fixtures rendered and disposed without errors. Inspected the initial inline actions in all four themes and the final six-action layout in Dark and Light High Contrast.
  • Browser keyboard check reached all six tunnel actions and verified they fit without clipping. Tests verify confirmation/cancellation, duplicate protection, backend failure, post-confirmation state changes, stale discovery, and focus restoration after deletion.

Automated validation did not delete real tunnels or perform a live server upgrade. Clipboard values, preference persistence, cancellation, missing-provider behavior, reconnect failures, duplicate actions, advertised upgrade methods, restart delays, stale capabilities, and error notifications are covered by tests. The maintainer exercised live upgrades and identified separate existing startup-timeout/duplicate-supervisor and reconnect-target issues; those are not fixed by this PR. Custom-hover display could not be verified in the isolated fixture; the actions use the existing shared toolbar hover delegate unchanged.

Manual checks

  • Open Remote Environments and copy an SSH, tunnel, WSL, and offline Environment address.
  • On SSH and tunnels, cancel Change Preferred Agent Location and confirm no preference or connection change.
  • Choose either preferred location and confirm it is saved and the host reconnects; verify a reconnect failure is reported without losing the preference.
  • Confirm Update Server appears only for incompatible hosts advertising an upgrade method; verify progress, restart/reconnect, and failures on a suitable test host.
  • Cancel Delete on a test tunnel and confirm it remains; confirm deletion and verify its service-side registration and local row are removed.
  • Confirm a tunnel hosted by this application cannot be deleted until hosting stops.
  • Reach the new actions using the keyboard; confirm Copy Address remains available during a pending connection or update.

Copilot AI balanced review requested due to automatic review settings October 26, 2026 12:54
@vs-code-engineering vs-code-engineering Bot added the cherry-pick-artifact Auto-generated cherry-pick PR label Oct 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: dbe9007c Current: 35a7223b

Changed (18)

sessions/remotes/remotesWidget/ConnectionError/Light
Before After
before after
sessions/remotes/remotesWidget/ConnectionRetry/Light
Before After
before after
sessions/remotes/remotesWidget/ShortEmpty/Light
Before After
before after
sessions/remotes/remotesWidget/Environments/Light
Before After
before after
sessions/remotes/remotesWidget/EnvironmentActions/Light
Before After
before after
sessions/remotes/remotesWidget/RefreshingTunnels/Light
Before After
before after
sessions/remotes/remotesWidget/TunnelDiscoveryFailure/Light
Before After
before after
sessions/remotes/remotesWidget/TunnelSignIn/Light
Before After
before after
sessions/remotes/remotesWidget/TunnelSigningIn/Light
Before After
before after
sessions/remotes/remotesWidget/EnvironmentsEmpty/Light
Before After
before after
sessions/remotes/remotesWidget/EnvironmentsWarning/Light
Before After
before after
sessions/remotes/remotesWidget/Table/Light
Before After
before after
sessions/remotes/remotesWidget/Wide/Light
Before After
before after
sessions/remotes/remotesWidget/Windows/Light
Before After
before after
sessions/remotes/remotesWidget/Empty/Light
Before After
before after
sessions/remotes/remotesWidget/EmptyWindows/Light
Before After
before after
sessions/remotes/remotesWidget/RefreshWarnings/Light
Before After
before after
sessions/remotes/remotesWidget/EmptyRefreshWarnings/Light
Before After
before after

Added (1)

sessions/remotes/remotesWidget/InlineActions/Light

current

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Stale background discovery can restore deleted tunnels, and asynchronous action changes can lose or unexpectedly move keyboard focus.

3 open issues
What changed in this PR

Cherry-picks inline remote-management actions into the Agents Window’s Remote Environments editor, reusing existing management services and dialogs.

Changes:

  • Adds Copy Address, preferred agent location, server update, and supported tunnel deletion actions.
  • Prefers fresh tunnel metadata and adds deletion safeguards.
  • Expands accessibility guidance, regression tests, and themed fixtures; updates the WSL documentation link.
File Description
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​electron-browser/​remotesEditor.test.ts Extends the model stub with new actions.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​remotesWidget.test.ts Tests action availability, keyboard behavior, and failures.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​remotesWidget.fixture.ts Adds themed inline-action fixtures.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​remotesModel.test.ts Tests management flows, metadata precedence, and deletion safeguards.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​electron-browser/​remotes.contribution.ts Documents new actions in accessibility help.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​remotesWidget.ts Dispatches actions and manages pending state and focus.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​remotesTable.ts Renders capability-dependent row actions.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​remotesModel.ts Implements management actions and tunnel inventory handling.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​remoteHostOptions.ts Shares deletion confirmation and server-upgrade helpers.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​remoteAgentHostActions.ts Reuses shared confirmation in the Tunnels picker.
src/​vs/​platform/​agentHost/​common/​wslRemoteAgentHost.ts Updates the WSL setup documentation URL.

Review effort: Balanced

Comment on lines +424 to +425
this.tunnelDiscoveryVersion++;
this.targets.delete(id);
Comment on lines 301 to +303
if (template.column === 'actions' && template.actionLayout !== actionLayout) {
template.actionLayout = actionLayout;
template.toolbar.setActions(showConnection ? [template.action, template.rename, ...(showDelete ? [template.delete] : [])] : [
template.toolbar.setActions(showConnection ? [
const activeRow = dom.isHTMLElement(active) && this.domNode.contains(active) ? active.closest<HTMLElement>('[data-remote-id]') : undefined;
const index = this.rows.findIndex(row => row.id === id);
if (activeRow && activeRow.dataset.remoteId !== id && index >= 0) {
if (index >= 0 && (activeRow && activeRow.dataset.remoteId !== id
@chrmarti
Christof Marti (chrmarti) merged commit 07bebfe into release/1.144 Oct 26, 2026
45 checks passed
@chrmarti
Christof Marti (chrmarti) deleted the cherry-pick/344228 branch October 26, 2026 14:10
@vs-code-engineering vs-code-engineering Bot added this to the 1.144.0 milestone Oct 26, 2026
Christof Marti (chrmarti) added a commit that referenced this pull request Oct 26, 2026
<!-- Thank you for submitting a Pull Request. Please:
* Read our Pull Request guidelines:

https://github.com/microsoft/vscode/wiki/How-to-Contribute#pull-requests
* Associate an issue with the Pull Request.
* Ensure that the code is up-to-date with the `main` branch.
* Include a description of the proposed changes and how to test them.
-->

## Summary

- Rename **Manage...** in the Environment picker to **Manage Remote
Environments...**.
- Align the setting description and chat/Remotes accessibility help with
the new label.
- Preserve the command, visibility gates, selected environment, and
per-host Manage submenus.

Rebased onto `origin/release/1.144` at `62620115296` to avoid the
unrelated chat-move test regression introduced on main by #344057
(`13832cc4487`). The diff remains the same six-file label-only change.
Follow-up to the release backports #344266 and #344313; related to
#344263.

## Validation

- `npm run build-fast -- --client-only` - passed after rebasing onto
release/1.144.
- Focused picker and accessibility tests on release/1.144 - **79
passing**:

```powershell
.\scripts\test.bat --run src\vs\sessions\contrib\chat\test\browser\sessionEnvironmentPicker.test.ts --run src\vs\sessions\contrib\chat\test\browser\sessionsChatAccessibilityHelp.test.ts --reporter dot
```

- Release-diff ESLint and hygiene - **6 files passed**; whitespace check
passed:

```powershell
$files = @(git diff --name-only origin/release/1.144...HEAD -- '*.ts')
npm run eslint -- $files
node build\hygiene.ts $files
git diff --check origin/release/1.144...HEAD
```

This is a string-only change; full type-check and smoke/integration
suites were not run.

## Manual check

Open the Environment picker, select **Manage Remote Environments...**,
and verify Remotes management opens without changing the selected
environment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick-artifact Auto-generated cherry-pick PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants